﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;




namespace HAVTKPack
{

    /// <summary>
    /// 用于表示一个filter处理工具
    /// </summary>
    [Serializable]
    public abstract class Filter
    {
        #region 构造函数

        public Filter(string id)
        {
            this._id = id;
            this._desc = id;
        }


        #endregion



        #region 字段属性

        string _id;

        public string Id
        {
            get { return _id; }
           
        }

        string _desc;

        public string Desc
        {
            get { return _desc; }
            set { _desc = value; }
        }












        protected bool _visiability = true;
        /// <summary>
        /// 标记是否可见
        /// </summary>
        public bool Visiability
        {
            get { return _visiability; }
            set
            {
                //if (_visiability != value)
                {
                    _visiability = value;

                    this.OnSetVisibility();
                }
            }
        }

        protected REPRESENTATIONTYPE _repType = REPRESENTATIONTYPE.WIREFRAME;
        /// <summary>
        /// 外观表现类型
        /// </summary>
        public REPRESENTATIONTYPE RepType
        {
            get { return _repType; }
            set
            {
                if (_repType != value)
                {

                    _repType = value;

                    this.OnSetRepresentationType();

                }

            }
        }



        protected CONTOURTYPE _contourType = CONTOURTYPE.Linear;
        /// <summary>
        /// 标记着色方式
        /// Linear:面不进行着色，以线（等值线，等值面的边框线）形式显示，并着色
        /// ColorFill：线不显示，面进行显示并着色
        /// LinearAndColorFill:线显示并着色，面显示并着色   
        /// </summary>
        public CONTOURTYPE ContourType
        {
            get { return _contourType; }
            set {
                if (_contourType != value)
                {
                    _contourType = value;

                    this.OnSetContourType();

                }
            }
        }



      


        #endregion


        #region 公用方法

         protected virtual void OnSetVisibility()
        {


        }


         protected virtual void OnSetRepresentationType()
         {


         }


         protected virtual void OnSetContourType()
         { 
         
         
         }


        public abstract void Render();

        public abstract void StopRender();    
        
        #endregion

    }
}
